package com.swx.identityservice.models;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Table(name = "scbp_dept")
@ApiModel(value = "部门实体类")
public class ScbpDept {

    @Id
    @Column(name = "Id")
    @ApiModelProperty(value = "自增id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ApiModelProperty(value = "父id")
    @Column(name = "Pid")
    private Integer pid;

    @ApiModelProperty(value = "部门名称", example = "高检院", notes = "这个名字必须为title，因为前端框架就是这个")
    //    @NotNull(message = "不能为空")
    @Column(name = "Title")
    private String title;

    //    @NotNull(message = "不能为空")
    @ApiModelProperty(value = "办理业务集合id", example = "1,2,3")
    @Column(name = "HandleBusiness")
    private String handleBusiness;

    //    @NotNull(message = "不能为空")
    @Column(name = "StatisticalDeptMapping")
    @ApiModelProperty(value = "统计部门映射集合id", example = "1,2,3")
    private String statisticaldeptmapping;

    //    @NotNull(message = "不能为空")
    @ApiModelProperty(value = "文号部门简称", example = "简称")
    @Column(name = "AbbreviationDept")
    private String abbreviationdept;

    @ApiModelProperty(value = "文号部门简称", example = "简称")
    @Column(name = "TopId")
    private Integer topid;

    @Transient
    private String rname;

    @Transient
    private String uname;

    @Transient
    private Integer rid;

    @Transient
    private Integer uid;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "CreationTime")
    private Date creationtime;

    /**
     * 创建人Id
     */
    @Column(name = "CreatorUserId")
    private Integer creatoruserid;

    /**
     * 最后修改时间
     */
    @ApiModelProperty(value = "最后修改时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "LastModificationTime")
    private Date lastmodificationtime;

    @ApiModelProperty(value = "备注", example = "该部门缺人，请招人")
    @Column(name = "Remark")
    private String remark;

    @Column(name = "SelectDept")
    @ApiModelProperty(value = "部门选择", example = "1")
    @NotNull(message = "不能为空")
    private String selectdept;

    /**
     * 更新人Id
     */
    @ApiModelProperty(value = "修改人id")
    @Column(name = "LastModifierUserId")
    private Integer lastmodifieruserid;

    @Transient
    private Integer dtopid;

    /**
     * 删除标记
     */
    @ApiModelProperty(value = "是否删除", example = "0否，1是")
    @Column(name = "IsDeleted")
    private Boolean isdeleted;


    @NotNull(message = "不能为空")
    @ApiModelProperty(value = "案件号部门简称", example = "案件号部门简称")
    @Column(name = "CaseNumberAbbreviationDept")
    private String casenumberabbreviationdept;

    @NotNull(message = "不能为空")
    @Column(name = "WHAbbreviationDept")
    @ApiModelProperty(value = "文号部门简称", example = "文号部门简称")
    private String whabbreviationdept;

    @ApiModelProperty(value = "排序", example = "1")
    @Column(name = "SortNum")
    private Integer sortnum;

    public String getRname() {
        return rname;
    }

    public Integer getRid() {
        return rid;
    }

    public void setRid(Integer rid) {
        this.rid = rid;
    }

    public void setRname(String rname) {
        this.rname = rname;
    }

    @Transient
    private List<ScbpRole> roles = new ArrayList<>();


    public String getSelectdept() {
        return selectdept;
    }

    public String getStatisticaldeptmapping() {
        return statisticaldeptmapping;
    }


    public void setStatisticaldeptmapping(String statisticaldeptmapping) {
        this.statisticaldeptmapping = statisticaldeptmapping;
    }

    public void setSelectdept(String selectdept) {
        this.selectdept = selectdept;
    }

    public List<ScbpRole> getRoles() {
        return roles;
    }

    public void setRoles(List<ScbpRole> roles) {
        this.roles = roles;
    }

    public String getHandleBusiness() {
        return handleBusiness;
    }

    public void setHandleBusiness(String handleBusiness) {
        this.handleBusiness = handleBusiness;
    }


    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "DeletionTime")
    private Date deletiontime;


    @Column(name = "DeleterUserId")
    private Integer deleteruserid;


    public Integer getId() {
        return id;
    }


    public void setId(Integer id) {
        this.id = id;
    }


    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAbbreviationdept() {
        return abbreviationdept;
    }

    public void setAbbreviationdept(String abbreviationdept) {
        this.abbreviationdept = abbreviationdept;
    }

    public String getCasenumberabbreviationdept() {
        return casenumberabbreviationdept;
    }

    public void setCasenumberabbreviationdept(String casenumberabbreviationdept) {
        this.casenumberabbreviationdept = casenumberabbreviationdept;
    }


    public Integer getDtopid() {
        return dtopid;
    }

    public void setDtopid(Integer dtopid) {
        this.dtopid = dtopid;
    }


    public String getWhabbreviationdept() {
        return whabbreviationdept;
    }

    public void setWhabbreviationdept(String whabbreviationdept) {
        this.whabbreviationdept = whabbreviationdept;
    }


    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public Integer getSortnum() {
        return sortnum;
    }

    public void setSortnum(Integer sortnum) {
        this.sortnum = sortnum;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getTopid() {
        return topid;
    }

    public void setTopid(Integer topid) {
        this.topid = topid;
    }


    public Date getCreationtime() {
        return creationtime;
    }


    public void setCreationtime(Date creationtime) {
        this.creationtime = creationtime;
    }

    public String getUname() {
        return uname;
    }

    public void setUname(String uname) {
        this.uname = uname;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }


    public Integer getCreatoruserid() {
        return creatoruserid;
    }


    public void setCreatoruserid(Integer creatoruserid) {
        this.creatoruserid = creatoruserid;
    }

    public Date getLastmodificationtime() {
        return lastmodificationtime;
    }

    public void setLastmodificationtime(Date lastmodificationtime) {
        this.lastmodificationtime = lastmodificationtime;
    }

    public Integer getLastmodifieruserid() {
        return lastmodifieruserid;
    }

    public void setLastmodifieruserid(Integer lastmodifieruserid) {
        this.lastmodifieruserid = lastmodifieruserid;
    }

    public Boolean getIsdeleted() {
        return isdeleted;
    }

    public void setIsdeleted(Boolean isdeleted) {
        this.isdeleted = isdeleted;
    }

    public Date getDeletiontime() {
        return deletiontime;
    }


    public void setDeletiontime(Date deletiontime) {
        this.deletiontime = deletiontime;
    }


    public Integer getDeleteruserid() {
        return deleteruserid;
    }

    public void setDeleteruserid(Integer deleteruserid) {
        this.deleteruserid = deleteruserid;
    }


}
